
************************************************************
*  Regressions in Table 4
************************************************************

clear
# delimit ;
version 11;
capture log close;
set more 1;

use data_5yr_stacked;
log using table4.log, replace;

quietly tab regno, gen(reg);
quietly tab agegroup, gen(agegroup);

gen lgreg=0;
replace lgreg=1 if north==1;
replace lgreg=2 if norwest==1;
replace lgreg=3 if central==1;
replace lgreg=3 if regno==16;
replace lgreg=4 if cenchern==1;
replace lgreg=5 if volga==1;
replace lgreg=6 if povolzh==1;
replace lgreg=7 if ncauc==1;
replace lgreg=8 if urals==1;
replace lgreg=9 if esib==1;
replace lgreg=10 if wsib==1;
replace lgreg=11 if fareast==1;

gen time=0 if agegroup==1;
replace time=1 if agegroup==2;
replace time=2 if agegroup==3;
replace time=3 if agegroup==4;
replace time=4 if agegroup==5;
replace time=5 if agegroup==6;
replace time=6 if agegroup==7;

*  Married fertility rates;
*  Age 16-44;
reg asbrm sr10a lnpopm urbshf i.agegroup i.regno i.regno#c.time if agegroup !=7, cluster(regno);
reg asbrm sr10a lnpopm urbshf i.agegroup i.regno i.regno#c.time if agegroup !=7 [aw=popf], cluster(regno);

*  Urban;
reg asbrmu sr10u lnpopmu i.agegroup i.regno i.regno#c.time if agegroup !=7, cluster(regno);
reg asbrmu sr10u lnpopmu i.agegroup i.regno i.regno#c.time if agegroup !=7 [aw=popfu], cluster(regno);

*  Rural;
reg asbrmr sr10r lnpopmr i.agegroup i.regno i.regno#c.time if agegroup !=7, cluster(regno);
reg asbrmr sr10r lnpopmr i.agegroup i.regno i.regno#c.time if agegroup !=7 [aw=popfr], cluster(regno);

*  Unmarried fertility rates;
reg asbrnd sr10a lnpopm urbshf i.agegroup i.regno i.regno#c.time if agegroup !=7, cluster(regno);
reg asbrnd sr10a lnpopm urbshf i.agegroup i.regno i.regno#c.time if agegroup !=7 [aw=popf], cluster(regno);

*  Urban;
reg asbrndu sr10u lnpopmu i.agegroup i.regno i.regno#c.time if agegroup !=7, cluster(regno);
reg asbrndu sr10u lnpopmu i.agegroup i.regno i.regno#c.time if agegroup !=7 [aw=popfu], cluster(regno);

*  Rural;
reg asbrndr sr10r lnpopmr i.agegroup i.regno i.regno#c.time if agegroup !=7, cluster(regno);
reg asbrndr sr10r lnpopmr i.agegroup i.regno i.regno#c.time if agegroup !=7 [aw=popfr], cluster(regno);


*  % Out-of-wedlock births;
*  Age 16-44;
reg nodad sr10a lnpopm urbshf i.agegroup i.regno i.regno#c.time if agegroup !=7, cluster(regno);
reg nodad sr10a lnpopm urbshf i.agegroup i.regno i.regno#c.time if agegroup !=7 [aw=popf], cluster(regno);

*  Urban;
reg nodadu sr10u lnpopmu i.agegroup i.regno i.regno#c.time if agegroup !=7, cluster(regno);
reg nodadu sr10u lnpopmu i.agegroup i.regno i.regno#c.time if agegroup !=7 [aw=popfu], cluster(regno);

*  Rural;
reg nodadr sr10r lnpopmr i.agegroup i.regno i.regno#c.time if agegroup !=7, cluster(regno);
reg nodadr sr10r lnpopmr i.agegroup i.regno i.regno#c.time if agegroup !=7 [aw=popfr], cluster(regno);


*  Very large age gap at marriage (11+ years);
*  Women age 16-49;
reg vlargegap sr10a lnpopm urbshf i.agegroup i.regno i.regno#c.time, cluster(regno);
reg vlargegap sr10a lnpopm urbshf i.agegroup i.regno i.regno#c.time [aw=popf], cluster(regno);

* Urban;
reg vlargegapu sr10u lnpopmu i.agegroup i.regno i.regno#c.time, cluster(regno);
reg vlargegapu sr10u lnpopmu i.agegroup i.regno i.regno#c.time [aw=popfu], cluster(regno);

* Rural;
reg vlargegapr sr10r lnpopmr i.agegroup i.regno i.regno#c.time, cluster(regno);
reg vlargegapr sr10r lnpopmr i.agegroup i.regno i.regno#c.time [aw=popfr], cluster(regno);

clear;


*  Divorce regressions (diffeent age groups than previous regressions);
use data_5yr_stacked_div;

gen time=0 if agegroup==1;
replace time=1 if agegroup==2;
replace time=2 if agegroup==3;
replace time=3 if agegroup==4;
replace time=4 if agegroup==5;

quietly tab agegroup, gen(agegroup);

gen lgreg=0;
replace lgreg=1 if north==1;
replace lgreg=2 if norwest==1;
replace lgreg=3 if central==1;
replace lgreg=3 if regno==16;
replace lgreg=4 if cenchern==1;
replace lgreg=5 if volga==1;
replace lgreg=6 if povolzh==1;
replace lgreg=7 if ncauc==1;
replace lgreg=8 if urals==1;
replace lgreg=9 if esib==1;
replace lgreg=10 if wsib==1;
replace lgreg=11 if fareast==1;

*  Age 18-49;
*  Divorces per 1000 married population in each age group;
gen lnpop=log(pop);
gen lnpopu=log(popu);
gen lnpopr=log(popr);
gen urbsh=(popmu+popfu)/(popm+popf) ;

*  All pop;
reg divr sr10a lnpop urbsh i.agegroup i.regno i.regno#c.time, cluster(regno);
reg divr sr10a lnpop urbsh i.agegroup i.regno i.regno#c.time [aw=pop], cluster(regno);

*  Urban;
reg divru sr10u lnpopu i.agegroup i.regno i.regno#c.time, cluster(regno);
reg divru sr10u lnpopu i.agegroup i.regno i.regno#c.time [aw=popu], cluster(regno);

*  Rural;
reg divrr sr10r lnpopr i.agegroup i.regno i.regno#c.time, cluster(regno);
reg divrr sr10r lnpopr i.agegroup i.regno i.regno#c.time [aw=popr], cluster(regno);

clear;



*  Deaths from abortion regressions (diffeent age groups than previous regressions);
*  Abortion death data are for 16-19, 20-24, 25-29, 30-39 and 40-49 age groups;
*  No urban abortion death data 1959 for Chechnya --  missing from archives;
*  And no rural abortion data 1959 for Astrakhanskaya oblast and Khabarovskii krai;

use data_5yr_stacked_dabo;
sort agegroup;

gen time=0 if agegroup==1;
replace time=1 if agegroup==2;
replace time=2  if agegroup==3;
replace time=3 if agegroup==4;
replace time=4 if agegroup==5;

quietly tab regno, gen(reg);
quietly tab agegroup, gen(agegroup);

gen lgreg=0;
replace lgreg=1 if north==1;
replace lgreg=2 if norwest==1;
replace lgreg=3 if central==1;
replace lgreg=3 if regno==16;
replace lgreg=4 if cenchern==1;
replace lgreg=5 if volga==1;
replace lgreg=6 if povolzh==1;
replace lgreg=7 if ncauc==1;
replace lgreg=8 if urals==1;
replace lgreg=9 if esib==1;
replace lgreg=10 if wsib==1;
replace lgreg=11 if fareast==1;

*  Age 16-49;
reg dabobth sr10a lnpopm urbshf i.agegroup i.regno i.regno#c.time, cluster(regno);
reg dabobth sr10a lnpopm urbshf i.agegroup i.regno i.regno#c.time [aw=popf], cluster(regno);

*  Urban population;
reg dabobthu sr10u lnpopmu i.agegroup i.regno i.regno#c.time, cluster(regno);
reg dabobthu sr10u lnpopmu i.agegroup i.regno i.regno#c.time [aw=popfu], cluster(regno);

*  Rural population;
reg dabobthr sr10r lnpopmr i.agegroup i.regno i.regno#c.time, cluster(regno);
reg dabobthr sr10r lnpopmr i.agegroup i.regno i.regno#c.time [aw=popfr], cluster(regno);

log close;


